from application import db
from common.models.user import User

class MailOrder(db.Model):
    __tablename__ = 'mail_order'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    phone = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    address = db.Column(db.String(50, 'utf8mb4_0900_ai_ci'))
    detail = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))

    uid = db.Column(db.Integer,db.ForeignKey('user.id'))
    mark = db.Column(db.Integer)
    city = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    sn = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))

    updated_time = db.Column(db.DateTime)
    created_time = db.Column(db.DateTime)
    creater = db.relationship('User', foreign_keys=uid)